package com.crm.service.crm.businessOpportunities.controller;

import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.crm.businessOpportunities.dto.CustomInfoPageDto;
import com.crm.model.crm.businessOpportunities.dto.FishForDto;
import com.crm.service.crm.businessOpportunities.service.CustomInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/open_sea_pool")
@Slf4j
public class OpenSeaPool {

    @Autowired
    private CustomInfoService customInfoService;

    @PostMapping("/fishFor")
    public ResponseResult addByRevertId(@RequestBody FishForDto fishForDto){
        ResponseResult responseResult = customInfoService.addByRevertId(fishForDto);
        return responseResult;
    }

    @PostMapping("/list")
    public ResponseResult getAll(@RequestBody CustomInfoPageDto customInfoPageDto){
        ResponseResult byNotRevert = customInfoService.getByNotRevert(customInfoPageDto);
        return byNotRevert;
    }


}
